package com.sohoometer.station.dao;

import java.util.List;

import org.hibernate.SessionFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.nari.coreframe.dao.hibernate3.GenericDaoImpl;
import com.sohoometer.station.bean.PowerMeterInfo;

@Repository("powerMeterInfoDao")
public class PowerMeterInfoDaoImpl extends GenericDaoImpl<PowerMeterInfo, String> implements PowerMeterInfoDao {
	@Autowired
	public PowerMeterInfoDaoImpl(SessionFactory sessionFactory) {
		setSessionFactory(sessionFactory);
	}

	@Override
	public List<PowerMeterInfo> queryPowerInfoByUserId(String id) throws Exception {
		DetachedCriteria criteria = createDetachedCriteria().add(Restrictions.eq("userID", id));
			return queryEntityListCriteria(criteria);
	}
	
	
}
